package com.mmg.spzx.manager.controller;

import com.github.pagehelper.PageInfo;
import com.mmg.spzx.manager.service.SysOperLogService;
import com.mmg.spzx.model.dto.system.SysOperLogDto;
import com.mmg.spzx.model.entity.system.SysOperLog;
import com.mmg.spzx.model.vo.common.Result;
import com.mmg.spzx.model.vo.common.ResultCodeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "系统操作日志管理")
@RestController
@RequestMapping("/admin/system/sysOperLog")
public class SysOperLogController {

    @Autowired
    private SysOperLogService sysOperLogService;

    @Operation(summary = "条件分页查询")
    @GetMapping("/{page}/{limit}")
    public Result<PageInfo<SysOperLog>> findByPage(@PathVariable Integer page,
                                                   @PathVariable Integer limit,
                                                   SysOperLogDto sysOperLogDto) {
        PageInfo<SysOperLog> pageInfo = sysOperLogService.findByPage(page, limit, sysOperLogDto);
        return Result.build(pageInfo, ResultCodeEnum.SUCCESS);
    }
}
